import paho.mqtt.client as mqtt


def on_connect(client, userdata, flags, rc):
    print("Connected with result code: " + str(rc))

def on_message(client, userdata, msg):
    print("receive msg:",msg.topic,msg.payload)




sub_client=mqtt.Client()

sub_client.on_connect=on_connect
sub_client.on_message=on_message
sub_client.connect('127.0.0.1',1883,600)

sub_client.publish('mask_state',payload="{'angle':0}", qos=0)

